import { createRouter, createWebHistory } from 'vue-router'
import LayoutView from '@/views/layout/index.vue';
import UserView from '@/views/user/index.vue';
import UserLoginView from '@/views/login/index.vue';
import IndexView from '@/views/index/index.vue';
import categoryView from '@/views/category/index.vue';

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: LayoutView,
      children:[
      {path:'/',redirect:'/index'},
      {path:'/index',name:'index',component:IndexView},
      {path:'/category',name:'category',component:categoryView},
      {path:'/user',name:'user',component:UserView}
      ]
    },
   {path:'/user/login',name:'userLogin',component:UserLoginView}
  ]
})

export default router
